<div class="ibox float-e-margins">
    <div class="ibox-content" style="display: block;">
        {!! Form::open(['route' => 'admin.shop.brand.store', 'id' => 'create-brand-form', 'class' => 'form-horizontal', 'role' => 'form', 'method' => 'post', 'files' => true]) !!}
        <input type="hidden" name="shop_id" value="{{$shop_id}}">
        <div class="form-group">
            <label for="store-act-name" class="col-md-2 control-label">
                选择品牌：
            </label>
            <div class="col-md-10">
                <select class="form-control" name="brand_id">
                    @foreach($brands as $brand)
                        <option value="{{$brand->id}}">{!! $brand->name !!}</option>
                    @endforeach
                </select>
            </div>
        </div>

        <div class="form-group">
            {!! Form::label('store-act-url', '销售折扣：', ['class' => 'col-md-2 control-label']) !!}
            <div class="col-md-10">
                <div class="input-group m-b">
                    <input type="text" name="discount"
                           value="100"
                           class="form-control">
                    <span class="input-group-addon">%</span>
                </div>
            </div>
        </div>

        <div class="hr-line-dashed"></div>
        <div class="form-group">
            <div class="col-md-4 col-md-offset-2">
                <button class="btn btn-primary" type="submit">保存</button>
            </div>
        </div>

        {!! Form::close() !!}
    </div>
</div>
<script>

    $(function () {
        $('#create-brand-form').ajaxForm({
            success: function (result) {
                if (result.status) {
                    swal({
                        title: "保存成功！",
                        text: "",
                        type: "success"
                    }, function () {
                        window.location = '{{route('admin.shop.brand.index',['shop_id'=>$shop_id])}}';
                    });
                } else {
                    swal('保存失败', result.message, 'warning');
                }

            }
        });
    });
</script>